-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validator Proposer Rewrite #1462
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1462 +/- ##
=========================================
Coverage ? 72.19%
=========================================
Files ? 101
Lines ? 6638
Branches ? 0
=========================================
Hits ? 4792
Misses ? 1451
Partials ? 395 |
…r-proposer-rewrite
…r-proposer-rewrite
…r-proposer-rewrite
validator/client/service.go
Outdated
@@ -22,12 +23,14 @@ type ValidatorService struct { | |||
conn *grpc.ClientConn | |||
endpoint string | |||
withCert string | |||
p2p p2p.Broadcaster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validator client will touch p2p ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this design, yes. It's still under debate, I suppose, but this would be a trivial change if we wanted to offload broadcasting to the beacon chain node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, but nice tests!
validator/client/service.go
Outdated
@@ -22,12 +23,14 @@ type ValidatorService struct { | |||
conn *grpc.ClientConn | |||
endpoint string | |||
withCert string | |||
p2p p2p.Broadcaster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename this property? It clashes with the package name p2p and can be confusing to someone adding a method to this struct in the future. Also some IDEs complain.
@@ -0,0 +1,77 @@ | |||
package client | |||
|
|||
// Validator client proposer functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be a package level godoc comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, these are just the proposer related functions for the validator client. I will add a godoc package comment though
return | ||
} | ||
|
||
// Get pending deposit data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit more informative comment, perhaps: "fetch validator deposits into the ETH1.0 which have not yet been included in the beacon chain"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thinking, otherwise this comment is unnecessary since it doesn't add new information
return | ||
} | ||
|
||
// 2. Construct block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Punctuation in comments to maintain standard across repo
block.Signature = nil | ||
|
||
// 5. Broadcast to the network | ||
v.p2p.Broadcast(block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in discord, do this in the chain service after block being received
|
||
// ProposeBlock | ||
// | ||
// WIP - not done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer wip, more elaborate comment requested
…r-proposer-rewrite
…/prysm into validator-proposer-rewrite
This PR implements the majority of the block proposal routine.
Key changes: